package com.ruoyi.control.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.JhjsSixSixMapper;
import com.ruoyi.control.domain.JhjsSixSix;
import com.ruoyi.control.service.IJhjsSixSixService;

/**
 * 606机巷局扇Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class JhjsSixSixServiceImpl extends ServiceImpl<JhjsSixSixMapper, JhjsSixSix> implements IJhjsSixSixService //修改
{
    @Autowired
    private JhjsSixSixMapper jhjsSixSixMapper;

    /**
     * 查询606机巷局扇
     * 
     * @param tagName 606机巷局扇主键
     * @return 606机巷局扇
     */
    @Override
    public JhjsSixSix selectJhjsSixSixByTagName(String tagName)
    {
        return jhjsSixSixMapper.selectJhjsSixSixByTagName(tagName);
    }

    /**
     * 查询606机巷局扇列表
     * 
     * @param jhjsSixSix 606机巷局扇
     * @return 606机巷局扇
     */
    @Override
    public List<JhjsSixSix> selectJhjsSixSixList(JhjsSixSix jhjsSixSix)
    {
        return jhjsSixSixMapper.selectJhjsSixSixList(jhjsSixSix);
    }

    /**
     * 新增606机巷局扇
     * 
     * @param jhjsSixSix 606机巷局扇
     * @return 结果
     */
    @Override
    public int insertJhjsSixSix(JhjsSixSix jhjsSixSix)
    {
        return jhjsSixSixMapper.insertJhjsSixSix(jhjsSixSix);
    }

    /**
     * 修改606机巷局扇
     * 
     * @param jhjsSixSix 606机巷局扇
     * @return 结果
     */
    @Override
    public int updateJhjsSixSix(JhjsSixSix jhjsSixSix)
    {
        jhjsSixSix.setUpdateTime(DateUtils.getNowDate());
        return jhjsSixSixMapper.updateJhjsSixSix(jhjsSixSix);
    }

    /**
     * 批量删除606机巷局扇
     * 
     * @param tagNames 需要删除的606机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsSixSixByTagNames(String[] tagNames)
    {
        return jhjsSixSixMapper.deleteJhjsSixSixByTagNames(tagNames);
    }

    /**
     * 删除606机巷局扇信息
     * 
     * @param tagName 606机巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteJhjsSixSixByTagName(String tagName)
    {
        return jhjsSixSixMapper.deleteJhjsSixSixByTagName(tagName);
    }
    /**
     * 查询前端显示数据
     * @return
     */
    @Override
    public List<JhjsSixSix> getList() {
        List<JhjsSixSix> jhjsSixSixList = new ArrayList<>();
        List<String> fanData = Arrays.asList("JKMS","JXMS","YKMS","ZJDY","ZJYJDJDY","ZJEJDJDY","YTJWZ","ZJDJWD","FL","FS","BJDY","BJDJWD","BJYJDJDY","BJEJDJDY","JDJWZ");
        for (String fanDatum : fanData) {
            JhjsSixSix jhjsSixSix = jhjsSixSixMapper.selectJhjsSixSixByTagName(fanDatum);
            jhjsSixSixList.add(jhjsSixSix);
        }
        return jhjsSixSixList;
    }
}
